#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>


int removeElement(int* nums, int numsSize, int val) {
    for (int i = 0; i < numsSize-1; i++)
    {
        while (nums[i] == val)
        {
            for (int j = i; j < numsSize - 1; j++)
            {
                nums[j] = nums[j + 1];
            }
            numsSize--;
        }
    }
    return numsSize;
}
int main()
{
    int arr[] = { 0,1,2,2,3,0,4,2 };
    int p = removeElement(arr, 8, 2);
    return 0;
}